<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page session="true"%>
<%@ include file="dbcon.jsp" %>
<!DOCTYPE html>
<html lang="ko">
<%@include file="topHead.jsp" %>

<body>
<%@include file="topcategory.jsp" %>

<div class="top-tab top-hidden-xs">
	<%@include file="tab.jsp" %>
</div>
		<div class="top-container top-margin-top-100">
<%
	if (!login) {
%>		
			<div class="top-table-size1 top-center">
			<form id="uMemId" role="form" method="post" action="uMemLoginOk.jsp">
				<div class="top-td-size">					
					<div class="top-td top-inline-group">
						<input type="text" name="id" class="top-input" placeholder="아이디를 입력하세요.">
						<input type="password" name="pw" class="top-input" placeholder="비밀번호를 입력하세요."> 
					</div>	
					<div class="top-td top-inline-group">
						<button class="top-btn-custom top-btn-lg-custom" type="submit">LOGIN</button>					
					</div>															
				</div>	
				<div class="top-td-size">
					<div class="top-inline-group">
						<a href="uMemFindId.jsp"><input type="button" class="top-btn-size2 top-btn-custom top-btn-sm-custom" value="아이디찾기"></a>
						<a href="uMemFindPw.jsp"><input type="button" class="top-btn-size2 top-btn-custom top-btn-sm-custom" value="비번찾기"></a>
					</div>
				</div>				
				<br /><br /><br />
				<div class="top-line-all top-td-size">
					<div class="top-td top-text-left">
						<h3>회원가입</h3>
						<h4>TOP의 더 많은 혜택을 누려보세요.</h4>
						<a href="uMemAdd.jsp"><input type="button" class="top-btn-custom top-btn-sm-custom top-btn-size4" value="회원가입"></a>
					</div>
				</div>
			</form>
		<div class="top-margin-bottom-100"></div>
	</div>
	<div class="top-hidden-xs">
		<%@include file="topBottom.jsp" %>
	</div>	
	
<%
	} else {
		web.openPopup("defaultPopup.jsp", "topmainpage.jsp", null);
	}
%>
		</div>	

		<!-- 형식검사 클래스 참조 -->
		<script src="assets/js/string.js"></script>
		<!-- 구현 부분 -->
		<script type="text/javascript">
			$(function() {
				// 디자인된 팝업창을 띄우는 함수
				function popup(str) {
					window.open("defaultPopup.jsp?title=" + str, "POP", "width=250,height=250,scrollbars=no");
				}
				
				$("#uMemId").submit(function() {
					// 아이디 입력여부 검사
					if (!$("input[name='id']").val().isValue()) {
						popup("아이디를 입력하세요.");
						$("input[name='id']").focus();
						return false;
					}
					 
					// 아이디 유효 검사
					if (!$("input[name='id']").val().isAlphabetNum()) {
						popup("아이디는 영어와 숫자값만 가능합니다.");
						$("input[name='id']").focus();
						return false;
					}
					
					// 패스워드 입력여부 검사
					if (!$("input[name='pw']").val().isValue()) {
						popup("패스워드를 입력하세요.");
						$("input[name='pw']").focus();
						return false;
					}					
				});				
			});
		</script>
	</body>
</html>